#include <iostream>
#include <queue>

using namespace std;

struct TreeNode
{
    int val;
    TreeNode* left;
    TreeNode* right;
    TreeNode(int x)
        :val(x)
        ,left(nullptr)
        ,right(nullptr)
    {}
};
bool isCompleteTree(TreeNode* root)
{
    queue<TreeNode*> que;
    que.push(root);

    TreeNode* pre = root;
    while (que.empty() == false)
    {
        TreeNode* top = que.front();
        if (pre == nullptr && top != nullptr)
        {
            return false;
        }
        if (top != nullptr && top->left == nullptr && top->right != nullptr)
        {
            return false;
        }

        if (top)
        {
            que.push(top->left);
            que.push(top->right);
        }
        que.pop();
        pre = top;
    }
    return true;
}
int main()
{

	return 0;
}